package com.kws.merchant.service.impl;


import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.kws.merchant.domain.OperationRepertory;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.kws.merchant.domain.po.RepertoryPo;
import com.kws.merchant.mapper.OperationRepertoryMapper;
import com.kws.merchant.service.OperationRepertoryService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;

/**
 * 运维-库存管理(OperationRepertory)表服务实现类
 *
 * @author yxy
 * @since 2024-10-28 15:39:21
 */
@Service("operationRepertoryService")
public class OperationRepertoryServiceImpl extends ServiceImpl<OperationRepertoryMapper, OperationRepertory> implements OperationRepertoryService {

    @Resource
    private OperationRepertoryMapper operationRepertoryMapper;


    /**
     * 分页查询列表
     */
    @Override
    public Page<OperationRepertory> pageList(RepertoryPo repertoryPo) {
        Page<OperationRepertory> page = new Page<>(repertoryPo.getPageSize(), repertoryPo.getTotalPage());
        LambdaQueryWrapper<OperationRepertory> queryWrapper = Wrappers.lambdaQuery();
        String name = repertoryPo.getName();//备件名称
        if (StringUtils.isNotEmpty(name)){
            queryWrapper.eq(OperationRepertory::getName,name);
        }
        return this.page(page, queryWrapper);
    }


}
